package jnpf.base.util.visualUtil;

import jnpf.util.visiual.JnpfKeyConsts;

/**
 *
 *
 * @author JNPF开发平台组
 * @version V3.4
 * @copyright 引迈信息技术有限公司（https://www.jnpfsoft.com）
 * @date  2022/5/9
 */
public class ChooseFiledTypeUtil {

	/**
	 * 根据 控件字段返回 所需字段类型
	 * @param jnpfKey
	 * @return
	 */
	public static String getTypeByJnpfKey(String jnpfKey){
		String type = "varchar";
		switch (jnpfKey) {
			case JnpfKeyConsts.TIME:
			case JnpfKeyConsts.DATE:
			case JnpfKeyConsts.CREATETIME:
			case JnpfKeyConsts.MODIFYTIME:
				type = "datetime";
				break;
			case JnpfKeyConsts.NUM_INPUT:
			case JnpfKeyConsts.CALCULATE:
				type = "double";
				break;
			case JnpfKeyConsts.EDITOR:

				type = "text";
				break;
		}
		return type;
	}

}
